package lanqiao;

import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;

import java.util.Scanner;

public class test3 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        String str = scan.next();
        int[] arr=new int[26];
        int index=0;
        int count=1;
        int sum=0;
        int sum1=0;
        int i=0;
            for(int j=1;j<str.length();){

                if(str.charAt(i)==str.charAt(j)){
                    count++;
                    j++;

                }else
                    {
                    arr[index++]=count;
                    if(count>1){
                        sum1+=2;
                    }
                    else{
                        sum1++;
                    }
                    sum+=count;
                    count=1;
                    i=j;
                    j++;
                }
            }
        if(count>1){
            sum1+=2;
        }
        else{
            sum1++;
        }
            arr[index]=count;


            if(sum1>=str.length()){
                System.out.println("NO");
                System.out.println("here");
                System.exit(0);
            }

        for (int i1 = 0; i1 < arr.length; i1++) {

            if(arr[i1]==1){
                System.out.print((char)('A'+i1));
            }
            if(arr[i1]>1){
                char c=(char)('A'+i1);
                System.out.print(c+""+arr[i1]);
            }
        }

        scan.close();
    }
}
